package org.mat.ipaas.ucenter.bff.admin.modules.system;

import lombok.extern.slf4j.Slf4j;
import org.mat.framework.lang.dto.MatApiResponse;
import org.mat.ipaas.ucenter.service.api.system.SysUploadRestAPI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * minio文件上传示例
 */
@Slf4j
@RestController
@RequestMapping("/sys/upload")
public class SysUploadController {

    @Autowired
    private SysUploadRestAPI sysUploadRestAPI;

    /**
     * 上传
     * @param request
     */
    @PostMapping(value = "/uploadMinio")
    public MatApiResponse<?> uploadMinio(HttpServletRequest request) throws Exception {
        MatApiResponse<?> matApiResponse = sysUploadRestAPI.uploadMinio(request);
        return matApiResponse;
    }
}
